Skip to main content

Connecting ps-dispatch

In the ps-dispatch/main/client/alerts.lua replace the HouseRobbery function with this

ps-dispatch/main/client/alerts.lua:311
local function HouseRobbery(coords)
local coords = coords or GetEntityCoords(cache.ped)

local dispatchData = {
message = locale('houserobbery'),
codeName = 'houserobbery',
code = '10-90',
icon = 'fas fa-house',
priority = 2,
coords = coords,
gender = GetPlayerGender(),
street = GetStreetAndZone(coords),
alertTime = nil,
jobs = { 'leo' }
}

TriggerServerEvent('ps-dispatch:server:notify', dispatchData)
end
exports('HouseRobbery', HouseRobbery)

In client/editable_client.lua replace the event with this:

sf-houserobbery/client/editable_client.lua:371
RegisterNetEvent("sf-houserobbery:dispatch", function(coords)
exports['ps-dispatch']:HouseRobbery(coords)
end)

Replace the DispatchHouse function in server/main.lua with this:

sf-houserobbery/server/main.lua:34
function DispatchHouse(source, houseId)
local playerPing = GetPlayerPing(source)
if(playerPing > 0 and playerPing < 500) then
TriggerClientEvent("sf-houserobbery:dispatch", source, Config.Houses[houseId].coords.xyz)
else
local house = Houses[houseId]
for k, v in pairs(house.players) do
playerPing = GetPlayerPing(k)
if(playerPing > 0 and playerPing < 500) then
TriggerClientEvent("sf-houserobbery:dispatch", k, Config.Houses[houseId].coords.xyz)
break
end
end
end
end
note

Restart the server first before testing the changes